from manimlib import *
class SquareToCircle(Scene):
    def construct(self):
        circle = Circle()
        circle.set_fill(BLUE, opacity=0.5)
        circle.set_stroke(BLUE_E, width=4)
        square = Square()

        self.play(ShowCreation(square))
        self.wait()
        self.play(ReplacementTransform(square,circle))
        self.wait()

        # 启用交互
        self.embed()
        """ 终端手动输入 """
        # 在水平方向上拉伸到四倍
        # play(circle.animate.stretch(4, dim=0))
        # 旋转90°
        # play(Rotate(circle, TAU / 4))
        # 在向右移动2单位同时缩小为原来的1/4
        # play(circle.animate.shift(2 * RIGHT), circle.animate.scale(0.25))
        
        # exit # 退出